Resize image to store in database