Trim whitespace from image