Put image creation in function

Only allow 4 image sizes to make more aesthetically pleasing images