Reduced DB calls to only when image is first created, added Quality setting for ImageMagick

...hitting the DB when the image already exists. Also added $quality attribute for ImageMagick version.