fix getPic function