Welcome to PHPBuilder! When posting PHP code, please use the board's [noparse]
..
[/noparse] bbcode tags as they make your code much easier to read and analyze.
As for your issue... what is the purpose of all of this code:
$image_query= mysql_query (" SELECT `album_id`, `ext`, FROM `images` WHERE `image_id`=$image_id AND `user_id`=".$_SESSION['user_id'] );
$image_result = mysql_fetch_assoc($image_query);
$album_id = $image_result['album_id'];
$image_ext = $image_result['ext'];
? The reason I ask is because at present, all of it is superfluous and could be removed since you never use any of those variables.
Furthermore... where are the image files stored? Can you give us an example of what values you're passing in via 'image_id' in the query string?