imagemagick: force return null if exception
Image generator: replace catch closes by thow