Make the image returning method a little smarter