Image Upload Preview Widget: Detect image orientation and rotate the upside down images properly