Updated gallery script to use data-image attribute instead of src if it's provided.