cleanup
fixed image format computation error