scale image before upload