Fixed image.php initialization and remove unsed code