Thumbnail and images with PHP get var support

Not sure why github isn't letting me submit two separate pull requests for two separate commits, any advice would be appreciated.

First one makes it so you can hover over a thumbnail on reddit to open the hoverzoom window

Second one adds support for images that end with "?*" PHP get vars, for example 
http://www.reddit.com/r/PerfectTiming/comments/1zfvxy/after_a_pilots_first_combat_mission/
links to the image:
http://i.imgur.com/HlfzA7S.jpg?1

Previously, the ?1 would have prevented a regex match.