Fix image format bug