modifications from wic for proper image rotation and cleaning up dndzip