trying to sort out image resizing