Add image resize code