fix bug which resizes img everytime it is requested in a different size