Improving file resize and image loading