better method of storing resized image