uncommented image resizing code... and created functions for incorporating preferences