Image capture function