Handle forced image size
Move main routine below functions