Added the gallery viewer and some jpg for the necessary testing.
Modified the original script with auto-width capatibility.