new function to resize the imaeg after it has been loaded in for the fuirst time