Optimized getImages method using one liner