Change resized image type to jpeg; fix the attachment collection find function