added relative scaling to image resize