resize image function, not the scope of the project