fix small bug that could allow imgur gifs to come through. Also, only add .jpg if necessary