Seperate out image resize function into seperate module