fix equals method warning, fix space allocation for image byte array with metadata

cleaned up some unnecessary exceptions