Adding error checking for shrink images