organised resize image function and made it run only if there are new images