added view counter and image viewing