RewriteRule \.jpe?g$ imageview.php
imageview.php
<?php
session_start();
$_SESSION['image'] = $_SERVER['REQUEST_URI'];
?>
<html>
<head>
<style>body { background-color: #000; }</style>
</head>
<body>
<img src="image.php">
</body>
</html>
image.php
<?php
session_start();
// find and open image locally
$im = '/path/to/'.$_SESSION['image'];
// output headers
header('Content-type: image/jpeg');
// output image
imagejpeg($im);
That should give you the idea.
edit: Damn I just reread what you said, I think you would need 2 files, one to output basic html for a black background and another to output the image. Redid my psuedo code.