added swiping picture function