image resizing and precompile