p.s image size has nothing to do with it, it was 3 in the original code