profile upload rails common method