Improvment to inline GIF and image fitting