added submission from Kelly Campbell that fixed synchronization problem with GifJpeg image handling. Also cleaned up code to follow existing coding conventions.